import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/login'
import Layout from '@/layout'
import Home from '@/views/home'
import Equipment from '@/views/equipment'
import Status from '@/views/equipment/status'
import Type from '@/views/equipment/type.vue'
import Personnel from '@/views/personnel'
import Workload from '@/views/personnel/workload.vue'
import Peoplework from '@/views/personnel/peoplework.vue'

import Strategy from '@/views/strategy'
import Order from '@/views/order'
import Bill from '@/views/bill'
import goodsManage from '@/views/goods/goodsManage.vue'
import goodsType from '@/views/goods/goodsType.vue'
import Operate from '@/views/work/operate'
import Maintain from '@/views/work/maintain/index.vue'
import Point from '@/views/pointGG/poin'
import Regional from '@/views/pointGG/Regional'
import Partners from '@/views/pointGG/Partners'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: Login, meta: { title: '登录' } },
  {
    path: '/',
    component: Layout,
    meta: { title: '帝可得后台' },
    redirect: '/home',
    children: [
      // 首页
      { path: 'home', component: Home },
      // 工单管理
      { path: 'operate', component: Operate },
      { path: 'maintain', component: Maintain },

      // 蒋国涛的点位管理 Point Regional  Partners
      { path: 'point', component: Point },
      { path: 'Regional', component: Regional },
      { path: 'Partners', component: Partners },
      // 设备管理路由
      { path: '/equipment/index', component: Equipment },
      { path: '/equipment/status', component: Status },
      { path: '/equipment/type', component: Type },
      { path: 'personnel', component: Personnel },
      { path: 'workload', component: Workload },
      { path: 'peoplework', component: Peoplework },
      { path: 'strategy', component: Strategy },
      { path: 'order', component: Order },
      { path: 'bill', component: Bill },
      { path: 'goodsManage', component: goodsManage },
      { path: 'goodsType', component: goodsType }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
